package com.intellif.spring_boot_autoconfiguration.bootstrap;

import com.intellif.spring_boot_autoconfiguration.service.CalculateService;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication(scanBasePackages = "com.intellif.spring_boot_autoconfiguration.service")
public class CalculateServiceBootstrap {
    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = new SpringApplicationBuilder(CalculateServiceBootstrap.class).
                web(WebApplicationType.NONE).profiles("Java8").
                run(args);
        CalculateService calculateService = applicationContext.getBean(CalculateService.class);
        System.out.println("calculateService sum： "+calculateService.sum(1,2,3,4,5,6,7,8,9,10));
        applicationContext.close();
    }
}
